package com.example.workshop.lesson11;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;


@Component
@Scope(value= ConfigurableBeanFactory.SCOPE_PROTOTYPE,proxyMode = ScopedProxyMode.TARGET_CLASS)
public class Movie {
    private Logger logger= LoggerFactory.getLogger(this.getClass());
    private String name;
    private int id;
    private String genre;
    private String producer;


    public  Movie(){
        super();
        logger.info("In Movie constructor method");
    }

    private void postConstruct(){
        //初始化代码
         logger.info("In Movie postConstruct method");
    }
  @PreDestroy
    private void preDestroy(){
        //用于清除的代码
        logger.info("In Movie postConstruct method");
    }
    public double movieSimilarity(){
        //计算相似度
        //genre+0.3    procedure+0.5
        double similarity=0.0;
        return similarity;
    }
}
